/**********************************************************************
 * SailmiPIM - modular cross-platform feature Personal Information Manager Tools.
 * Copyright(C) 2006-2014  Georg Rudoy
 *
 * Distributed under the Boost Software License, Version 1.0.
 *(See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
 **********************************************************************/

#pragma once

#include <optional>
#include <QObject>
#include <QUuid>
#include <QString>
#include <QList>
#include <QSqlDatabase>
#include <util/db/oral/oralfwd.h>

namespace SailmiPIM
{
    class SysStorage : public QObject
	{
	public:
        struct UserRecord;
	private:
		QSqlDatabase DB_;

        Util::oral::ObjectInfo_ptr<UserRecord> UserRecord_;
	public:
        explicit SysStorage(QObject* = nullptr);
        ~SysStorage();

		using Id = QUuid;

        void AddUser(const Id&,
                     const QString&,
                     const QString&,
                     const QString&,
                     const QString&,
                     const QString&);
        void DeleteUser(const Id&);
        bool loginUser(const QString&, const QString&);
	};
}
